package com.elder.business.mapper;

import com.elder.business.domain.ElderMedicatePaln;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 用药计划Mapper接口
 * 
 * @author elder
 * @date 2024-04-20
 */
public interface ElderMedicatePalnMapper 
{
    /**
     * 查询用药计划
     * 
     * @param id 用药计划主键
     * @return 用药计划
     */
    public ElderMedicatePaln selectElderMedicatePalnById(Long id);

    /**
     * 查询用药计划列表
     * 
     * @param elderMedicatePaln 用药计划
     * @return 用药计划集合
     */
    public List<ElderMedicatePaln> selectElderMedicatePalnList(ElderMedicatePaln elderMedicatePaln);

    /**
     * 新增用药计划
     * 
     * @param elderMedicatePaln 用药计划
     * @return 结果
     */
    public int insertElderMedicatePaln(ElderMedicatePaln elderMedicatePaln);

    /**
     * 修改用药计划
     * 
     * @param elderMedicatePaln 用药计划
     * @return 结果
     */
    public int updateElderMedicatePaln(ElderMedicatePaln elderMedicatePaln);

    /**
     * 删除用药计划
     * 
     * @param id 用药计划主键
     * @return 结果
     */
    public int deleteElderMedicatePalnById(Long id);

    /**
     * 批量删除用药计划
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteElderMedicatePalnByIds(Long[] ids);

    List<ElderMedicatePaln> getElderMedicatePalnList(@Param("elderIds") List<Long> elderIds);

    List<ElderMedicatePaln> getElderMedicatePalnListByElderId(@Param("elderId") Long elderId,@Param("planType") Integer planType);

    ElderMedicatePaln getCurrentDayMedicatePaln(@Param("elderId")  Long elderId,@Param("startTime")  Long startTime,@Param("endTime")  Long endTime,@Param("planType") Integer planType);

    Integer updateMedicatePaln(@Param("timeBucket") String timeBucket,@Param("Id") Long Id);

    ElderMedicatePaln getElderMedicatePalnCurrentMonth(@Param("currentMonthStartTime")Long currentMonthStartTime,@Param("currentMonthEndTime") Long currentMonthEndTime,@Param("planType") Integer planType);

    ElderMedicatePaln getElderMedicatePalnBtId(@Param("id") Long id);

    List<ElderMedicatePaln> getElderMedicatePalnPIdList(@Param("id") Long id);

    int deleteElderMedicatePalnByPlanIds(@Param("planIds") List<Long> planIds);
}
